<?php
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/logic/CustomCommand.php';
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/model/factory/DaoFactory.php';
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/model/entity/ClientAddress.php';
	
	/*
	* Class to create a client address
	*/
	class CommandCreateClientAddress extends CustomCommand {
		/*
		 * Constructor of the class
		 */
		public function __construct($clientAddress) {
			$this -> clientAddress = $clientAddress;
		}
		
		/*
		 * Method to execute to create a client address
		 */
		public function execute() {
			$daoFactory = DaoFactory :: getMySqlDaoFactory();
			$icaad = $daoFactory -> getMySqlClientAddressAccessDao();			
			$clientAddressCreation = $icaad -> createClientAddress($this -> clientAddress);
	
			$this -> result = $clientAddressCreation;
		}
	}
?>